package com.hlxj.license.server.util;

/**
 * @功能:【StringUtil 】
 * @作者:代守诚
 * @日期:2019/5/24
 * @时间:11:05
 */
public class StringUtil {

    public static String bytesToString(byte[] encrytpByte) {
        String result = "";
        for (Byte bytes : encrytpByte) {
            result += bytes.toString() + " ";
        }
        return result;
    }

    public static byte[] stringToBytes(String data) {
        String[] strArr = data.split(" ");
        int len = strArr.length;
        byte[] clone = new byte[len];
        for (int i = 0; i < len; i++) {
            clone[i] = Byte.parseByte(strArr[i]);
        }

        return clone;
    }
}
